import 'package:get/get.dart';
import 'package:nft_shop/my/model/models.dart';
import 'package:nft_shop/net/service_repository.dart';
import 'package:nft_shop/res/constant.dart';

class WebConteroller extends GetxController {
  ConfigNameDetail? article;

  late int status = LoadStatusType.loading;

  static WebConteroller get to => Get.put(WebConteroller());

  void getConfigNameDetail(String name)async{
    try{
      List list = await ServiceRepository.getConfigNameDetail(name);
      list.forEach((element) {
        if(element.name.toString().trim() == name){
          article = element;
        }
      });
      if(article != null){
        status = LoadStatusType.success;
      }else{
        status = LoadStatusType.empty;
      }
    }catch(e,s){
      status = LoadStatusType.empty;
    }
    update();
  }
}